<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>中国移动收银台</title>
<script type="text/javascript" src="/js/jquery-1.9.1.js"></script>
<link rel="stylesheet" href="/css/weui.min.css"/>
    <script type="text/javascript">
	//调用微信JS api 支付
	function jsApiCall()
	{
		WeixinJSBridge.invoke(
			'getBrandWCPayRequest',
			${parameters},
			function(res){
				
				if(res.err_msg == "get_brand_wcpay_request:ok"){  
					$('#toastsuccess').show();
                }else if(res.err_msg == "get_brand_wcpay_request:cancel"){  
                	$('#toastcancel').show();
                }else{  
                	$('#toastfail').show();
                }
				 setTimeout(function () {
					 WeixinJSBridge.call('closeWindow');
			        }, 2000);
				
			}
		);
	}

	function callpay()
	{
		if (typeof WeixinJSBridge == "undefined"){
		    if( document.addEventListener ){
		        document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
		    }else if (document.attachEvent){
		        document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
		        document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
		    }
		}else{
		    jsApiCall();
		}
	}
	
	window.onload = function(){
		callpay();
	};
	</script>
</head>
<body>
       <div id="toastsuccess" style="display: none;">
                <div class="weui_mask_transparent"></div>
                <div class="weui_toast">
                    <i class="weui_icon_toast"></i>
                    <p class="weui_toast_content">支付完成</p>
                </div>
       </div>
       <div id="toastfail" style="display: none;">
                <div class="weui_mask_transparent"></div>
                <div class="weui_toast">
                    <i class="weui_icon_toast"></i>
                    <p class="weui_toast_content">支付失败</p>
                </div>
       </div>
       <div id="toastcancel" style="display: none;">
                <div class="weui_mask_transparent"></div>
                <div class="weui_toast">
                    <i class="weui_icon_toast"></i>
                    <p class="weui_toast_content">支付取消</p>
                </div>
       </div>
</body>
</html>